#!/bin/sh

mkdir -p /mnt/overlay/etc/

# Network
mkdir -p /mnt/overlay/etc/NetworkManager/system-connections

if [ ! -f /mnt/overlay/etc/hostname ]; then
    cp -fp /etc/hostname /mnt/overlay/etc/hostname
fi

if [ ! -f /mnt/overlay/etc/hosts ]; then
    cp -fp /etc/hosts /mnt/overlay/etc/hosts
fi

# TimeSync
if [ ! -f /mnt/overlay/etc/systemd/timesyncd.conf ]; then
    mkdir -p /mnt/overlay/etc/systemd
    cp -fp /etc/systemd/timesyncd.conf /mnt/overlay/etc/systemd/timesyncd.conf
fi

if [ ! -L /mnt/overlay/etc/localtime ]; then
    ln -sf /usr/share/zoneinfo/Etc/UTC /mnt/overlay/etc/localtime
fi

# Console
if [ ! -f /mnt/overlay/etc/vconsole.conf ]; then
    echo "KEYMAP=us" > /mnt/overlay/etc/vconsole.conf
fi
